package com.hongpu.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 冷却塔安装人员考勤打卡
 * @TableName cool_tower_project_attendance
 */
@TableName(value ="cool_tower_project_attendance")
@Data
public class CoolTowerProjectAttendance implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id",  type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    /**
     * 项目ID
     */
    @TableField(value = "cool_tower_project_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long coolTowerProjectId;

    /**
     * 员工ID
     */
    @TableField(value = "cool_tower_employee_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long coolTowerEmployeeId;

    /**
     * 打卡日期
     */
    @TableField(value = "check_in_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING,  pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date checkInDate;

    /**
     * 工数
     */
    @TableField(value = "number_of_jobs")
    private BigDecimal numberOfJobs;

    /**
     * 其他费用
     */
    @TableField(value = "other_expenses")
    private BigDecimal otherExpenses;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 数据生成时间
     */
    @TableField(value = "create_time",  fill = FieldFill.INSERT)
    @JsonFormat(shape = JsonFormat.Shape.STRING,  pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    /**
     * 数据修改时间
     */
    @TableField(value = "update_time",fill = FieldFill.UPDATE)
    @JsonFormat(shape = JsonFormat.Shape.STRING,  pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

    /**
     * 数据生成操作人ID
     */
    @TableField(value = "create_by",  fill = FieldFill.INSERT)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long createBy;

    /**
     * 数据修改操作人ID
     */
    @TableField(value = "update_by",  fill = FieldFill.UPDATE)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long updateBy;

    /**
     * 数据逻辑删除标识
     */
    @TableField(value = "deleted",fill = FieldFill.INSERT)
    @TableLogic
    private Integer deleted;

    /**
     * 租户ID
     */
    @TableField(value = "tenant_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long tenantId;

    /**
     * 日结费用
     */
    @TableField(value = "daily_settlement_fee")
    private BigDecimal dailySettlementFee;

    /**
     * 当天费用=日结费用+其他费用+补助
     */
    @TableField(value = "daily_fee")
    private BigDecimal dailyFee;

    /**
     * 补助
     */
    @TableField(value = "subsidy")
    private BigDecimal subsidy;

    /**
     * 员工编号
     */
    @TableField(exist = false)
    private String workNum;

    /**
     * 员工名称
     */
    @TableField(exist = false)
    private String name;



    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CoolTowerProjectAttendance other = (CoolTowerProjectAttendance) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCoolTowerProjectId() == null ? other.getCoolTowerProjectId() == null : this.getCoolTowerProjectId().equals(other.getCoolTowerProjectId()))
            && (this.getCoolTowerEmployeeId() == null ? other.getCoolTowerEmployeeId() == null : this.getCoolTowerEmployeeId().equals(other.getCoolTowerEmployeeId()))
            && (this.getCheckInDate() == null ? other.getCheckInDate() == null : this.getCheckInDate().equals(other.getCheckInDate()))
            && (this.getNumberOfJobs() == null ? other.getNumberOfJobs() == null : this.getNumberOfJobs().equals(other.getNumberOfJobs()))
            && (this.getOtherExpenses() == null ? other.getOtherExpenses() == null : this.getOtherExpenses().equals(other.getOtherExpenses()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
            && (this.getTenantId() == null ? other.getTenantId() == null : this.getTenantId().equals(other.getTenantId()))
            && (this.getDailySettlementFee() == null ? other.getDailySettlementFee() == null : this.getDailySettlementFee().equals(other.getDailySettlementFee()))
            && (this.getDailyFee() == null ? other.getDailyFee() == null : this.getDailyFee().equals(other.getDailyFee()))
            && (this.getSubsidy() == null ? other.getSubsidy() == null : this.getSubsidy().equals(other.getSubsidy()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCoolTowerProjectId() == null) ? 0 : getCoolTowerProjectId().hashCode());
        result = prime * result + ((getCoolTowerEmployeeId() == null) ? 0 : getCoolTowerEmployeeId().hashCode());
        result = prime * result + ((getCheckInDate() == null) ? 0 : getCheckInDate().hashCode());
        result = prime * result + ((getNumberOfJobs() == null) ? 0 : getNumberOfJobs().hashCode());
        result = prime * result + ((getOtherExpenses() == null) ? 0 : getOtherExpenses().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getTenantId() == null) ? 0 : getTenantId().hashCode());
        result = prime * result + ((getDailySettlementFee() == null) ? 0 : getDailySettlementFee().hashCode());
        result = prime * result + ((getDailyFee() == null) ? 0 : getDailyFee().hashCode());
        result = prime * result + ((getSubsidy() == null) ? 0 : getSubsidy().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", coolTowerProjectId=").append(coolTowerProjectId);
        sb.append(", coolTowerEmployeeId=").append(coolTowerEmployeeId);
        sb.append(", checkInDate=").append(checkInDate);
        sb.append(", numberOfJobs=").append(numberOfJobs);
        sb.append(", otherExpenses=").append(otherExpenses);
        sb.append(", remark=").append(remark);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", createBy=").append(createBy);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", deleted=").append(deleted);
        sb.append(", tenantId=").append(tenantId);
        sb.append(", dailySettlementFee=").append(dailySettlementFee);
        sb.append(", dailyFee=").append(dailyFee);
        sb.append(", subsidy=").append(subsidy);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}